<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="t" tagdir="/WEB-INF/tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<t:masterpage>
    <jsp:body>
        <c:url value="/donations" var="donationsUrl" />
        <h2>Edit donations for ${moneyBackPageModel.operation.receiptor.firstName} ${moneyBackPageModel.operation.receiptor.lastName}</h2>
        <form:form method="post"
            action="${donationsUrl}/${moneyBackPageModel.operation.receiptor.id}/moneyback/${moneyBackPageModel.operation.donator.id}/submit.html"
            modelAttribute="moneyBackPageModel.operation">
            <form:hidden path="id" />
            <form:hidden path="receiptor.id" />
            <form:hidden path="donator.id" />
            <form:hidden path="humanResources.id" />
            <form:hidden path="year" />
            <div class="horizontal_pad">
            <table class="form">
                <tr>
                    <th><label>Donator</label></th>
                    <td class="horizontal_pad" colspan="2"><label>${moneyBackPageModel.operation.donator.firstName} ${moneyBackPageModel.operation.donator.lastName}</label></td>
                </tr>
                <tr>
                    <th><label>Donated Amount</label></th>
                    <td class="horizontal_pad" colspan="2"><label>${moneyBackPageModel.donator.amount}</label></td>
                </tr>
                <tr>
                    <th valign="top"><form:label path="amount">Amount</form:label></th>
                    <td class="horizontal_pad"><form:input path="amount" /><br/>
                    <form:errors class="text-error" path="amount" /></td>
                </tr>
            </table>
            </div>
            <div class="form-actions">
                <input class="btn btn-primary" type="submit"
                                value="Money Back" />
            </div>
        </form:form>  
    </jsp:body>
</t:masterpage>